package com.drink.yan.intf.define;

import org.springframework.util.CollectionUtils;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * java类简单作用描述
 *
 * @Title:
 * @Package: com.drink.yan.intf.define.
 * @Author: M.simple
 * @Remark: The modified content
 * @CreateDate: 2023-12-09 13:53
 * @Version: v2.0
 */
public enum YanCheckStatusE {

	check_succ("check_succ", "审核通过"),
	checking("checking", "审核中"),
	check_fail("check_fail", "审核不通过"),
	;

	private String code;

	private String remark;

	YanCheckStatusE(String code, String remark) {
		this.code = code;
		this.remark = remark;
	}

	public String getCode() {
		return code;
	}

	public String getRemark() {
		return remark;
	}

	public static void main(String[] args) {
		YanCheckStatusE[] values = YanCheckStatusE.values();
		StringBuffer sb = new StringBuffer();
		for(YanCheckStatusE yanOrderTypeE : values){
			sb.append(yanOrderTypeE.getCode()).append(":").append(yanOrderTypeE.getRemark()).append(" ");
		}
		System.out.println(sb.toString());
	}

	public static String code(String code){
		List<YanCheckStatusE> collect = Arrays.stream(YanCheckStatusE.values()).filter(x -> x.getCode().equals(code)).collect(Collectors.toList());
		if(CollectionUtils.isEmpty(collect)){
			return "";
		}
		return collect.get(0).getRemark();
	}
}
